<?php
/**
 * @file
 * opac_features.feeds_importer_default.inc
 */

/**
 * Implements hook_feeds_importer_default().
 */
function opac_features_feeds_importer_default() {
  $export = array();

  $feeds_importer = new stdClass();
  $feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
  $feeds_importer->api_version = 1;
  $feeds_importer->id = 'unionlib_biblio_importer';
  $feeds_importer->config = array(
    'name' => 'Unionlib biblio importer',
    'description' => '',
    'fetcher' => array(
      'plugin_key' => 'XaFeedsHTTPFetcher',
      'config' => array(
        'auto_detect_feeds' => 0,
        'use_pubsubhubbub' => 0,
        'designated_hub' => '',
        'request_timeout' => '',
        'auto_scheme' => 'http',
        'accept_invalid_cert' => 0,
        'cache_http_result' => 1,
        'one_time_source' => 1,
      ),
    ),
    'parser' => array(
      'plugin_key' => 'FeedsExJsonPath',
      'config' => array(
        'sources' => array(
          'book_record_no' => array(
            'name' => 'Book Record No',
            'value' => 'BOOKRECNO',
            'debug' => 0,
            'weight' => '1',
          ),
          'isbn' => array(
            'name' => 'ISBN',
            'value' => 'ISBN',
            'debug' => 0,
            'weight' => '2',
          ),
          'title' => array(
            'name' => '标题',
            'value' => 'TITLE',
            'debug' => 0,
            'weight' => '3',
          ),
          'publisher' => array(
            'name' => '出版社',
            'value' => 'PUBLISHER',
            'debug' => 0,
            'weight' => '4',
          ),
          'book_size' => array(
            'name' => '尺寸',
            'value' => 'BOOKSIZE',
            'debug' => 0,
            'weight' => '5',
          ),
          'book_type' => array(
            'name' => '书目类别',
            'value' => 'BOOKTYPE',
            'debug' => 0,
            'weight' => '6',
          ),
          'call_no' => array(
            'name' => '索书号',
            'value' => 'CALLNO',
            'debug' => 0,
            'weight' => '7',
          ),
          'class_no' => array(
            'name' => '分类号',
            'value' => 'CLASSNO',
            'debug' => 0,
            'weight' => '8',
          ),
          'language' => array(
            'name' => '语言',
            'value' => 'LANGUAGE',
            'debug' => 0,
            'weight' => '9',
          ),
          'notes' => array(
            'name' => '备注',
            'value' => 'NOTES',
            'debug' => 0,
            'weight' => '10',
          ),
          'page' => array(
            'name' => '总页数',
            'value' => 'PAGE',
            'debug' => 0,
            'weight' => '11',
          ),
          'price' => array(
            'name' => '价格',
            'value' => 'PRICE',
            'debug' => 0,
            'weight' => '12',
          ),
          'primary_author' => array(
            'name' => '主要著者',
            'value' => 'PRIMARY_AUTHOR',
            'debug' => 0,
            'weight' => '13',
          ),
          'author' => array(
            'name' => '著者',
            'value' => 'AUTHOR',
            'debug' => 0,
            'weight' => '14',
          ),
          'pub_date' => array(
            'name' => '出版时间',
            'value' => 'PUBDATE',
            'debug' => 0,
            'weight' => '15',
          ),
          'subject' => array(
            'name' => '主题',
            'value' => 'SUBJECT',
            'debug' => 0,
            'weight' => '16',
          ),
          'title_proper' => array(
            'name' => 'TITLE PROPER',
            'value' => 'TITLE_PROPER',
            'debug' => 0,
            'weight' => '17',
          ),
          'finish' => array(
            'name' => 'FINISH',
            'value' => 'FINISH',
            'debug' => 0,
            'weight' => '18',
          ),
          'cover' => array(
            'name' => '封面图片',
            'value' => 'COVER',
            'debug' => 0,
            'weight' => '19',
          ),
        ),
        'context' => array(
          'value' => 'data.data',
        ),
        'display_errors' => 0,
        'source_encoding' => array(
          0 => 'auto',
        ),
        'debug_mode' => 0,
      ),
    ),
    'processor' => array(
      'plugin_key' => 'XaFeedsEntityProcessorBiblio',
      'config' => array(
        'mappings' => array(
          0 => array(
            'source' => 'book_record_no',
            'target' => 'id',
            'unique' => 1,
            'language' => 'und',
          ),
          1 => array(
            'source' => 'book_record_no',
            'target' => 'guid',
            'unique' => 1,
            'language' => 'und',
          ),
          2 => array(
            'source' => 'title',
            'target' => 'title',
            'unique' => FALSE,
            'language' => 'und',
          ),
          3 => array(
            'source' => 'isbn',
            'target' => 'isbn',
            'unique' => FALSE,
            'language' => 'und',
          ),
          4 => array(
            'source' => 'publisher',
            'target' => 'publisher',
            'unique' => FALSE,
            'language' => 'und',
          ),
          5 => array(
            'source' => 'book_record_no',
            'target' => 'bookrecno',
            'unique' => FALSE,
            'language' => 'und',
          ),
          6 => array(
            'source' => 'book_type',
            'target' => 'booktype',
            'unique' => FALSE,
            'language' => 'und',
          ),
          7 => array(
            'source' => 'pub_date',
            'target' => 'pubdate',
            'unique' => FALSE,
            'language' => 'und',
          ),
          8 => array(
            'source' => 'notes',
            'target' => 'notes',
            'unique' => FALSE,
            'language' => 'und',
          ),
          9 => array(
            'source' => 'call_no',
            'target' => 'callno',
            'unique' => FALSE,
            'language' => 'und',
          ),
          10 => array(
            'source' => 'class_no',
            'target' => 'classno',
            'unique' => FALSE,
            'language' => 'und',
          ),
          11 => array(
            'source' => 'primary_author',
            'target' => 'primary_author',
            'unique' => FALSE,
            'language' => 'und',
          ),
          12 => array(
            'source' => 'author',
            'target' => 'author',
            'unique' => FALSE,
            'language' => 'und',
          ),
          13 => array(
            'source' => 'subject',
            'target' => 'subject',
            'unique' => FALSE,
            'language' => 'und',
          ),
          14 => array(
            'source' => 'language',
            'target' => 'lang',
            'unique' => FALSE,
            'language' => 'und',
          ),
          15 => array(
            'source' => 'book_size',
            'target' => 'booksize',
            'unique' => FALSE,
            'language' => 'und',
          ),
          16 => array(
            'source' => 'page',
            'target' => 'page',
            'unique' => FALSE,
            'language' => 'und',
          ),
          17 => array(
            'source' => 'book_type',
            'target' => 'booktype',
            'unique' => FALSE,
            'language' => 'und',
          ),
          18 => array(
            'source' => 'title_proper',
            'target' => 'title_proper',
            'unique' => FALSE,
            'language' => 'und',
          ),
          19 => array(
            'source' => 'price',
            'target' => 'price',
            'unique' => FALSE,
            'language' => 'und',
          ),
          20 => array(
            'source' => 'finish',
            'target' => 'finish',
            'unique' => FALSE,
            'language' => 'und',
          ),
          21 => array(
            'source' => 'cover',
            'target' => 'cover',
            'unique' => FALSE,
          ),
        ),
        'insert_new' => 1,
        'update_existing' => 0,
        'update_non_existent' => 'skip',
        'input_format' => NULL,
        'skip_hash_check' => FALSE,
        'bundle' => NULL,
        'values' => array(),
      ),
    ),
    'content_type' => 'biblio_feed',
    'update' => 0,
    'import_period' => '0',
    'expire_period' => 3600,
    'import_on_create' => 1,
    'process_in_background' => 0,
  );
  $export['unionlib_biblio_importer'] = $feeds_importer;

  $feeds_importer = new stdClass();
  $feeds_importer->disabled = TRUE; /* Edit this to true to make a default feeds_importer disabled initially */
  $feeds_importer->api_version = 1;
  $feeds_importer->id = 'unionlib_holding_importer';
  $feeds_importer->config = array(
    'name' => 'Unionlib holding importer',
    'description' => '',
    'fetcher' => array(
      'plugin_key' => 'FeedsHTTPFetcher',
      'config' => array(
        'auto_detect_feeds' => FALSE,
        'use_pubsubhubbub' => FALSE,
        'designated_hub' => '',
        'request_timeout' => NULL,
        'auto_scheme' => 'http',
        'accept_invalid_cert' => FALSE,
        'cache_http_result' => TRUE,
      ),
    ),
    'parser' => array(
      'plugin_key' => 'FeedsExJsonPath',
      'config' => array(
        'context' => array(
          'value' => 'data.data.list.*',
        ),
        'sources' => array(
          'barcode' => array(
            'name' => '条形码',
            'value' => 'BARCODE',
            'debug' => 0,
            'weight' => '1',
          ),
          'regdate' => array(
            'name' => '入藏时间',
            'value' => 'REGDATE',
            'debug' => 0,
            'weight' => '2',
          ),
          'book_record' => array(
            'name' => '书目号',
            'value' => 'BOOKRECNO',
            'debug' => 0,
            'weight' => '3',
          ),
          'call_no' => array(
            'name' => '索书号',
            'value' => 'CALLNO',
            'debug' => 0,
            'weight' => '4',
          ),
          'current_location' => array(
            'name' => '当前馆藏地',
            'value' => 'CURLOCAL',
            'debug' => 0,
            'weight' => '6',
          ),
          'current_library' => array(
            'name' => '当前图书馆',
            'value' => 'CURLIB',
            'debug' => 0,
            'weight' => '7',
          ),
          'origin_library' => array(
            'name' => '原始图书馆',
            'value' => 'ORGLIB',
            'debug' => 0,
            'weight' => '8',
          ),
          'origin_location' => array(
            'name' => '原始馆藏地',
            'value' => 'ORGLOCAL',
            'debug' => 0,
            'weight' => '9',
          ),
          'status' => array(
            'name' => '状态',
            'value' => 'STATUS',
            'debug' => 0,
            'weight' => '11',
          ),
          'create_date' => array(
            'name' => '创建时间',
            'value' => 'CREATEDATE',
            'debug' => 0,
            'weight' => '14',
          ),
          'check_time' => array(
            'name' => '核查时间',
            'value' => 'CHECKTIME',
            'debug' => 0,
            'weight' => '15',
          ),
          'vol_info' => array(
            'name' => '卷数信息',
            'value' => 'VOLINFO',
            'debug' => 0,
            'weight' => '16',
          ),
          'check_man' => array(
            'name' => '检查人',
            'value' => 'CHECKMAN',
            'debug' => 0,
            'weight' => '17',
          ),
          'bind_info' => array(
            'name' => '附加信息',
            'value' => 'BINDINFO',
            'debug' => 0,
            'weight' => '18',
          ),
        ),
        'display_errors' => 1,
        'debug_mode' => 1,
        'source_encoding' => array(
          0 => 'auto',
        ),
      ),
    ),
    'processor' => array(
      'plugin_key' => 'XaFeedsEntityProcessorHolding',
      'config' => array(
        'mappings' => array(
          0 => array(
            'source' => 'barcode',
            'target' => 'guid',
            'unique' => 1,
            'language' => 'und',
          ),
          1 => array(
            'source' => 'barcode',
            'target' => 'barcode',
            'unique' => FALSE,
            'language' => 'und',
          ),
          2 => array(
            'source' => 'barcode',
            'target' => 'title',
            'unique' => FALSE,
            'language' => 'und',
          ),
          3 => array(
            'source' => 'regdate',
            'target' => 'regdate',
            'unique' => FALSE,
            'language' => 'und',
          ),
          4 => array(
            'source' => 'call_no',
            'target' => 'callno',
            'unique' => FALSE,
            'language' => 'und',
          ),
          5 => array(
            'source' => 'current_location',
            'target' => 'curlocal',
            'unique' => FALSE,
            'language' => 'und',
          ),
          6 => array(
            'source' => 'current_library',
            'target' => 'curlib',
            'unique' => FALSE,
            'language' => 'und',
          ),
          7 => array(
            'source' => 'origin_library',
            'target' => 'orglib',
            'unique' => FALSE,
            'language' => 'und',
          ),
          8 => array(
            'source' => 'origin_location',
            'target' => 'orglocal',
            'unique' => FALSE,
            'language' => 'und',
          ),
          9 => array(
            'source' => 'book_record',
            'target' => 'bookrecno',
            'unique' => FALSE,
            'language' => 'und',
          ),
          10 => array(
            'source' => 'create_date',
            'target' => 'createdate',
            'unique' => FALSE,
            'language' => 'und',
          ),
          11 => array(
            'source' => 'check_time',
            'target' => 'checktime',
            'unique' => FALSE,
            'language' => 'und',
          ),
          12 => array(
            'source' => 'status',
            'target' => 'status',
            'unique' => FALSE,
            'language' => 'und',
          ),
          13 => array(
            'source' => 'vol_info',
            'target' => 'volinfo',
            'unique' => FALSE,
            'language' => 'und',
          ),
          14 => array(
            'source' => 'check_man',
            'target' => 'checkman',
            'unique' => FALSE,
          ),
        ),
        'insert_new' => 1,
        'update_existing' => 0,
        'update_non_existent' => 'skip',
        'input_format' => NULL,
        'skip_hash_check' => FALSE,
        'bundle' => NULL,
        'values' => array(),
      ),
    ),
    'content_type' => 'holding_feed',
    'update' => 0,
    'import_period' => '0',
    'expire_period' => 3600,
    'import_on_create' => 0,
    'process_in_background' => 1,
  );
  $export['unionlib_holding_importer'] = $feeds_importer;

  return $export;
}
